<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Devantech Drivers for Microsoft Robotics Studio</title>
    <style type="text/css">
    img { display:block; text-align: center;}
    html, body, p, li { font-family: Trebuchet MS, Sans-serif; font-size:14px; line-height: 20px; }
    h1{ font-size: 24px; padding: 20px 0 0px 0;  font-weight: normal;}
    h2 { font-size: 22px; padding: 20px 0 0 0; font-weight: normal;}
    p.warning {color: #880000; }
    p { color: #333333; }
    body { background: #999999; text-align: center;}
    div#mainColumn {width: 702px;}
    div#mainPadding {padding: 10px; text-align: left; border:1px solid white; background: #E5E5E5;}
    img#header { padding: 0; border:0; }
    </style>
</head>
<body>
    <br /><br />
    <div id="mainColumn">
    <a href="http://www.diversity.co.uk/robotics.html"><img src="diversity_simple_header.png" id="header" alt="Diversity Associates Ltd." width="702" height="50" border="0"/></a>
    <div id="mainPadding">
    <h1>Devantech Drivers for Microsoft Robotics Studio - version 0.8</h1>
    <p class="warning">
    <b >Warning:</b> Robots can be dangerous. They are at least as stupid as the code
        they run, often more so. Use at your own risk in a padded room free of valuables and people. If you are paranoid, you should read the code line by line and delete
        anything you don't understand. You have been warned.
    </p>
    <p>
        <strong>Note:</strong> This is a work in progress, and not all features behave as expected. For example, some services allow configuration from
    a web page, but fail to expose the same methods to other services. Others expose too many methods and don't keep internal messages private enough. We will
        try to make these better over time, but they are not perfect yet.
    </p>

    <p>
	The project home page is <a href="http://www.codeplex.com/DevantechMSRS">www.codeplex.com/DevantechMSRS</a>. If you can contribute to the project, please <a href="mailto:chris@diversity.co.uk">get in touch</a>.
	</p>
<p>
    <ul>
    <li>Recent Changes</li>
    <li>Introduction</li>
    <li>Usage</li>
    <li>I2C Hardware</li>
    <li>CMPS03 Compass</li>
    <li>TPA81 Thermopile Array</li>
    <li>TPA81 Map</li>
    <li>LCD03 Display</li>
    <li>MD23 Dual motor controller with encoders</li>
    <li>SD21 21 channel servo driver</li>
    <li>SD21 Sonar Pan</li>
    <li>SP03 Speech-to-text</li>
    <li>SRF08 Sonar</li>
    <li>SRF235 Sonar</li>
    <li>Install</li>
    <li>Running Sample Manifests</li>
    </ul>
     <h2>Recent Changes</h2>
    <p>
        Updated and recompiled for the release version of Microsoft Robotics Development 
        Studio 4 (beta 2)<br />
        The drivers now live in $MSRSRoot$/Apps/ so as not to get confused with the Microsoft provided samples.<br />
            </p>
            <p>
                cleanup of all code, added some documentation, used new features of Robotics Development Studio 2008. 
                Be sure to run DssProjectMigration.exe first to enable debugging.</p>
            <h4>
                older changes:</h4>
            <p>
        The namespace for Generics is no longer 'www.BehavioralTypes.org' after failed promises from the domain owner.<br />
        
        The <a href="http://www.diversity.co.uk/downloads/GenericMSRS.exe">GenericI2C</a> is now defined in a separate project that should be installed first.<br />
        If you are using the Serializer from <a href="http://www.roboticsconnection.com">Robotics Connection</a>, an implementation of the GenericI2C can be downloaded <a href="http://www.diversity.co.uk/downloads/SerializerGenericI2C.exe">here</a>.<br />
        An implementation of GenericI2C for the <a href="http://www.totalphase.com/products/aardvark/i2cspi/">Aardvark USB I2C</a> is reported to be in progress.
        <br />
        All XSLT files now use the MSRS look and feel.</p>
    <h2>Introduction</h2>
    <p>
    This is a collection of drivers that allow many of <a href="http://www.robot-electronics.co.uk">Devantech's devices</a> to be used from within <a href="http://msdn.microsoft.com/robotics">Microsoft Robotics Studio</a>.
    </p>
    <p>
        It started as personal project and has gained much from Devantech's continual help
        and support, but it&#39;s not an official Devantech product - please don't blame them
        for its faults.</p>
        <p>In comming releases
        we will concentrate on improving existing services before adding new devices (SRF02,
        MD22, MD03, SRF10 etc..). It should be noted that we have not made use of any AJAX connectors to refresh the state of the pages. When you 
        view a page, it shows you the state 
        at that instance and will not refresh without you refreshing the page with either a a right click, or
        by clicking the name of the service again.</p>
    
    <p>
        Since earlier versions prepared for the CTPs, the code has
        been extensively cleaned and refactored. All the main services are now configurable
        via their web pages and save their state to "/store" if you prefer to tweak the config that way.
        Many code comments have been added and structures improved. All projects can be
        started by right clicking and choosing debug. All Microsoft generics can be viewed
        via the web interface, but don't yet have stylesheets applied.</p>

        <h2>Usage</h2>

    <p>
    All the drivers make use of a generic I2C contract, so they could be used with any hardware that supports the generic I2C contract, allowing bytes to be read from and written to devices on the I2C bus.</p>
    <p>Devantech makes two such devices that allow a PC to talk to the I2C bus:
    </p>
    <ul>
    <li>The USBI2C adapter<br />
    One side plugs into an I2C port, and the other side speaks I2C</li>
    <li>The RF04/CM02 combination<br />
    The RF04 plugs into an I2C port and talks wirelessly to the CM02 which is attached to the I2C bus</li>
    </ul>
    <p>
    The I2C Hardaware driver included here supports both of these physical implementations
        transparently by using the COM version of the FTDI driver.</p>
    <h2>I2C Hardware</h2>
    <p>
    This service enables your PC to talk to all the devices. It includes some experimental code for scanning the I2C bus for attached
    devices and optionaly starting and monitoring services. If you click "Scan I2C bus", you should see the light on your physical I2C hardware flashing 
    like mad as it attempts a read from every address, and any further reads needed to disambiguate any devices. You should have patience and wait for it to 
    finsish before refreshing the page to see what it has found. Please don't try to power 100 devices from your USBI2C adaptor - they will misbehave.<br /><br />
    Although Devantech's I2C adaptors can use a "scan" command (not the same as bus scanning) to set motor power and read a compass and a bunch of SRF08s for you, this feature is not implemented.
    </p>
    <img src="usbi2c.png" />
    <h2>CMPS03 Compass</h2>
    <p>
    A very simple service that shows you the current heading. This service is missing proper subscription and configuration methods, however, using the web interface or
    the config file, you can control polling.
    </p>
    <img src="cmps03.png" />
    
    <h2>TPA81 Thermopile Array</h2>
    <p>
    The colors could do with some work. As is, flame will show in red but humans may be difficult to see. If you choose to enable
    panning, an attached servo will move back and forth so as to enable the map (see below).
    </p>
    <img src="tpa81.png" />
    
    <h2>TPA81 Map</h2>
    <p>
    The map shows a view of heat readings as the servo attached to the TPA81 pans. The colors show green for likely human heat, and red for hot flame. Although the ambient
        temperature is filtered out, it will not work well in hot countries where the ambient
        is close to human heat. Here you might be able to see a human leaning down from his chair and
        holding a lighter.
    </p>
    <img src="tpa81map.png" />
    
     <h2>LCD03 Display</h2>
    <p>
    Allows you to write text and control the backlight. Send it ASCII text to display on the screen.<br />
    The following special sequences can be used for primitive formatting:
    </p>
    <ul>
    <li>\r - line break</li>
    <li>\t - tab</li>
    <li>\u - up in the same column as the current char</li>
    <li>\d - down in the same colums as the current char</li>
    </ul>
    <img src="lcd03.png" />
    
    <h2>MD23 Dual motor controller with encoders</h2>
    <p>
    Shows the state of the encoders and allows you to configure polling. A Pid version of this is in the works, but was not ready for this
    release. It supports the generic Motor, Encoder, Battery and TwoWheelDifferentialDrive generics, which with the help of the dashboard can allow
    you to control your robot with a joystick and do primitive "move distance" and "rotate degrees" type commands.
    </p>
    <img src="md23.png" />
    
    <h2>SD21 21 channel servo driver</h2>
    <p>
        The central number can be draged left or right to move a servo within the range of the min and max limits that can also be draged. 
    Click in home or speed number to edit. A drag in the interface will be shown immediately without reading back from the SD21 
    where the servo actually is. Refer to the Devantech docs for detail of the meaning of the speed command but roughly: 0 is fast, and 
    any other number is relative to the amount in miliseconds that is moved every 20ms. i.e 1 is slow, and 20 is pretty fast.
    </p>
    <img src="sd21.png" />
    
    <h2>SD21 Sonar Pan</h2>
    <p>
    This is a combination service that controls the specified SD21 servo channel and subscribes to a generic Sonar. You will have to 
    configure a sonar such as the SRF08 to poll pretty fast, and start a generic Sonar that references it. (The manifest will do this for
    you if you have such devices). By using the speed command, a precise, timed pan, will move a servo back and forth, while receiving
    notifications of any sonar readings and estimating the angle of the servo at that instance. The results are shown in a scope-like
    image. In future, this service will provide a stream of posed sonar readings in conjunction with a pose from the forthcoming pid drive
    service and feed this to a mapping service for interpretation.
    </p>
    
    <img src="sd21sonarpan.png" />
    
     <h2>SP03 Speech-to-text</h2>
    <p>
    An alternative to the Microsoft text-to-speech service, for when you don't have a PC or speakers on your robot. You can feed this text 
    and it will speak remarkably well for a hardware device. The Speak phrase takes a number from 1-30 that will say a phrase previously
    stored by attaching the device to a serial port and uploading a bunch of phrases. Volume, Rate and Pitch take numbers from 0-7. It is
    best left at Volume zero (max) and low to mid range values for the others.
    
    </p>
    <img src="sp03.png" />
    
     <h2>SRF08 Sonar</h2>
    <p>
    When you have many sonars, it is best to use the broadcast polling, that instructs
        the sonars to do their ranging at the same time. If 
    you only want to talk to one, you can switch off the broadcast polling and talk to each device seperately. It
        supports the Sonar, AnalogueSensor, ContactSensor generics.</p>
    <img src="srf08.png" />
     <h2>SRF235 Sonar</h2>
    <p>
    Similar to the SRF08 except that the beam is much tighter and broadcast polling isn't supported. Note that the SRF235 has a shorter range and dislikes hard oblique surfaces -
    you may get many false 0 readings. It supports the Sonar and ContactSensor
        generics.</p>
    <img src="srf235.png" />
    
     <h2>Install</h2> 
<p>Run the self executable installer, or 
    Place the "Devantech" directory in "$MSRSRoot$\Apps\" directory. 
   </p>
   <p> 
    Compile the Devantech.sln solution. Then, you can test
    a service by right clicking on the Project and choosing Debug -> Start new instance,
    or start the services from the control panel using the Manifests provided. 
   </p>
   
    <h2>Running Sample Manifests</h2>

<p>
    To run a tutorial manifest,
    launch the MSRS command prompt, then type<br />

    <br />
     > cd samples\Platforms\Devantech\Config
    <br />


    > dssHost /p:50000 /m:RoboticsTutorial4.Devantech.manifest.xml 
    <br />
    (or another of the
    manifests provided) 
    </p>
    <h2>and finally...</h2>
    <p>
        They are not finished yet: your feedback, contributions and criticisms are important. Please tell us what you think.<br />
        <a href="mailto:chris@diversity.co.uk">chris@diversity.co.uk</a>
	Or use the discussion forums at CodePlex.
    </p>
    <br />
    </div>
    <img src="diversity_simple_footer.png" width="702" height="20" alt=""/>
    </div>
</body>
</html>
